#include <stdio.h>

int pows(int n,int m){
   int result=1,i=0;
   for(i=0;i<m;i++){
   	result=(result*n)%7;
   }
   return result;
} 

int main()
{
   int n,m,g; 
   scanf("%d %d",&n,&m);
   g=pows(n,m);
   switch (g){
    case 1:  printf("Monday"); break;
	case 2:  printf("Tuseday"); break;
	case 3:  printf("Wednesday"); break;
	case 4:  printf("Thursday"); break;
	case 5:  printf("Friday");  break;
	case 6:  printf("Saturday");  break;
	case 0:  printf("Sunday");  break;
   } 
   return 0;
}

